﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BMSVMM
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            propertyGrid1.SelectedObject = CRSettingsBMSVMM.myPrefs;
            propertyGrid2.SelectedObject = CRHotKeySettings.myPrefs;


            checkBox1.Checked = BurstKeySettings.myPrefs.useBurstMode;

            checkedListBox1.SetItemCheckState(0, BurstKeySettings.myPrefs.useBurstCrows ? CheckState.Checked : CheckState.Unchecked);
            checkedListBox1.SetItemCheckState(1, BurstKeySettings.myPrefs.useBurstRapidFire ? CheckState.Checked : CheckState.Unchecked);
            checkedListBox1.SetItemCheckState(2, BurstKeySettings.myPrefs.useBurstStampede ? CheckState.Checked : CheckState.Unchecked);
            checkedListBox1.SetItemCheckState(3, BurstKeySettings.myPrefs.useBurstTrinket1 ? CheckState.Checked : CheckState.Unchecked);
            checkedListBox1.SetItemCheckState(4, BurstKeySettings.myPrefs.useBurstTrinket2 ? CheckState.Checked : CheckState.Unchecked);
            checkedListBox1.SetItemCheckState(5, BurstKeySettings.myPrefs.useBurstEngiGloves ? CheckState.Checked : CheckState.Unchecked);
            checkedListBox1.SetItemCheckState(6, BurstKeySettings.myPrefs.useBurstBerserking ? CheckState.Checked : CheckState.Unchecked);
            checkedListBox1.SetItemCheckState(7, BurstKeySettings.myPrefs.useBurstBloodFury ? CheckState.Checked : CheckState.Unchecked);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CRSettingsBMSVMM.myPrefs.Save();
            CRHotKeySettings.myPrefs.Save();
            BurstKeySettings.myPrefs.Save();
            Close();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            BurstKeySettings.myPrefs.useBurstMode = checkBox1.Checked;
        }

        private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            BurstKeySettings.myPrefs.useBurstCrows = checkedListBox1.GetItemCheckState(0) == CheckState.Checked;
            BurstKeySettings.myPrefs.useBurstRapidFire = checkedListBox1.GetItemCheckState(1) == CheckState.Checked;
            BurstKeySettings.myPrefs.useBurstStampede = checkedListBox1.GetItemCheckState(2) == CheckState.Checked;
            BurstKeySettings.myPrefs.useBurstTrinket1 = checkedListBox1.GetItemCheckState(3) == CheckState.Checked;
            BurstKeySettings.myPrefs.useBurstTrinket2 = checkedListBox1.GetItemCheckState(4) == CheckState.Checked;
            BurstKeySettings.myPrefs.useBurstEngiGloves = checkedListBox1.GetItemCheckState(5) == CheckState.Checked;
            BurstKeySettings.myPrefs.useBurstBerserking = checkedListBox1.GetItemCheckState(6) == CheckState.Checked;
            BurstKeySettings.myPrefs.useBurstBloodFury = checkedListBox1.GetItemCheckState(7) == CheckState.Checked;
        }
    }
}
